<template>
  <div class="mt20 pr16">
    <!--基本信息-->
    <div class="common-form">拼团设置</div>
    <el-form >
      <el-form-item label="限购数量：">
      <el-input v-model="form.model.limit_num" placeholder="请输入限购数量" @input="changeValue" class="max-w460"></el-input>
    </el-form-item>
    <el-form-item label="开团人数：">
      <el-input v-model="form.model.assemble_num" placeholder="请输入开团人数" @input="changeValue" class="max-w460"></el-input>
    </el-form-item>
    <el-form-item label="虚拟销量：">
      <el-input v-model="form.model.sales_initial" placeholder="请输入虚拟销量" @input="changeValue" class="max-w460"></el-input>
    </el-form-item>
    
    <el-form-item label="商品排序：">
      <el-input v-model="form.model.sort" placeholder="请输入排序" @input="changeValue" class="max-w460"></el-input>
    </el-form-item>
    </el-form>
  </div>
</template>

<script>
import draggable from 'vuedraggable';
export default {
  components: {
  },
  data() {
    return {
      isProductUpload: false
    };
  },
  inject: ['form'],
  created() {

  },
  methods: {
    changeValue (e) {
      this.$forceUpdate()
    },
    /*打开上传图片*/
    openProductUpload: function() {
      this.isProductUpload = true;
    },

    /*上传商品图片*/
    returnProductImgsFunc(e) {
      if (e != null) {
        let imgs = this.form.model.image.concat(e);
        this.$set(this.form.model, 'image', imgs);
      }
      this.isProductUpload = false;
    },

    /*删除商品图片*/
    deleteImg(index) {
      this.form.model.image.splice(index, 1);
    },
  }
};
</script>

<style>
.edit_container {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  line-height: 20px;
  color: #2c3e50;
}

.ql-editor {
  height: 400px;
}

.draggable-list {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.draggable-list .wrapper > span {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.draggable-list .item {
  position: relative;
  width: 110px;
  height: 110px;
  margin-top: 10px;
  margin-right: 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dddddd;
}

.draggable-list .delete-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: red;
  line-height: 16px;
  font-size: 16px;
  color: #ffffff;
  display: none;
}

.draggable-list .item:hover .delete-btn {
  display: block;
}

.draggable-list .item img {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  max-height: 100%;
  max-width: 100%;
}

.draggable-list .img-select {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed #dddddd;
  font-size: 30px;
}

.draggable-list .img-select i {
  color: #409eff;
}
</style>
